<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
</body>
<script>
    function createTable(row, col, data, w, a){
        document.write("<table border=1 width="+ w +" align='"+ a +"'>");
        for(var i=0;i<row;i++){
            document.write("<tr align='"+ a +"'>")
            for(var j=0;j<col;j++){
                document.write("<td>"+ data +"</td>")
            }
            document.write("</tr>")
        }
        document.write("</table>");
    }

    createTable(3, 6, "hello", 1000, "center")
    createTable(4, 3, "world", 600, "right")
</script>
</html>